package cn.new18.testactivitytask.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.new18.testactivitytask.R;
import cn.new18.testactivitytask.dragview.MyDragView;

/**
 * Created by RaoWei on 2016/12/27 11:13.
 */

public class F extends Activity {
    @BindView(R.id.i_am_drag_view)
    MyDragView mIAmDragView;
    @BindView(R.id.center_color)
    TextView mCenterColor;
    @BindView(R.id.text)
    TextView mText;
    @BindView(R.id.img)
    ImageView mimg;
    private Toast mToast;
    private int i;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.f);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        i = 1;
    }


    @OnClick(R.id.img)
    public void onClick() {
        if (mToast == null) {
            mToast = Toast.makeText(this, "图片被点击了", Toast.LENGTH_SHORT);
            mCenterColor.setText("图片被点击了");
        } else {
            mToast.setText("图片被点击:" + ++i);
            mCenterColor.setText("图片被点击:" + i);
        }

        mToast.show();
    }
}
